<?php

namespace App\BO\Wechat\Meta;

class WechatPayResultMeta
{
    /**
     * @var string
     */
    private $appId;

    /**
     * @var string
     */
    private $timeStamp;

    /**
     * 随机串
     * @var string
     */
    private $nonceStr;

    /**
     * @var string
     */
    private $package;

    /**
     * 签名方式
     * @var string
     */
    private $signType = 'MD5';

    /**
     * @var string
     */
    public $paySign;

    public function __construct(array $data)
    {
        $this->appId = $data['appid'];
        $this->nonceStr = $data['nonce_str'];
        $this->package = 'prepay_id=' . $data['prepay_id'];
        $this->timeStamp = strval(time());
    }

    /**
     * @return string
     */
    public function getPackage(): string
    {
        return $this->package;
    }

    /**
     * @return string
     */
    public function getAppId(): string
    {
        return $this->appId;
    }

    /**
     * @return string
     */
    public function getNonceStr(): string
    {
        return $this->nonceStr;
    }

    /**
     * @return string
     */
    public function getTimeStamp(): string
    {
        return $this->timeStamp;
    }

    /**
     * @return string
     */
    public function getSignType(): string
    {
        return $this->signType;
    }
}
